/**
This file is part of Gel2DE.

    Gel2DE is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Gel2DE is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with Gel2DE.  If not, see <http://www.gnu.org/licenses/>.

	Copyright (C) 2012, University of Bergen
*/

#pragma once

#include "SpearmanRankElement.h"
#include <vector>
#include <algorithm>

class SpearmanRankData
{
public:
	SpearmanRankData(int aNelements);
	SpearmanRankData(std::vector<double>*, std::vector<double>*);
	~SpearmanRankData(void);

	void AddElement(double, double);
	void AddElements(std::vector<double>* aX, std::vector<double>* aY);
	void RankData();
	void Clear();
	std::vector<SpearmanRankElement*>* GetData();
	std::vector<int>* GetXties();
	std::vector<int>* GetYties();


private:

	void Rank(int);

	std::vector<SpearmanRankElement*>* m_data;
	std::vector<int>* m_nbrXties;
	std::vector<int>* m_nbrYties;

};



